package com.example.expandablelistview.fragmentdialog;

import android.app.Activity;
import android.app.DialogFragment;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.expandablelistview.R;

public class DlgListFrg extends Activity implements ListDialogFragment.NoticeDialogListener {
	TextView tv;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialogex);
		tv = (TextView) findViewById(R.id.commactivity_tv);
	}

	public void mOnClick(View v) {
		DialogFragment newFragment = new ListDialogFragment();
		Bundle bundle = new Bundle();
		bundle.putString("question", "음식을 선택하시오.");
		newFragment.setArguments(bundle);
		newFragment.show(getFragmentManager(), "Dialog");
	}

	@Override
	public void onDialogClick(DialogFragment dialog, String res) {
		tv.setText("선택한 과일은 = " + res);
		Toast.makeText(this, "선택한 과일은" + res, Toast.LENGTH_LONG).show();
	}

}
